#include <iostream>
#include <vector>
#include <cstdio> 
#include <set>
#include <assert.h>

#define in read()
#define fi first
#define se second
#define pb push_back

using namespace std;

typedef long long ll;
typedef double db;
typedef vector < int >  vec;
typedef pair < int , int > pii;

int read() {
  int x = 0; bool f = 0; char ch = getchar(); while(!isdigit(ch)) f |= ch == '-',ch = getchar();
  while(isdigit(ch)) x = x * 10 + (ch ^ 48),ch = getchar(); return f ? -x : x;
}

const int N = 2e5 + 10;

int n,fib[N],inb[N],siz[N],fa[N],pos;
set < int > G[N];

void dfs(int x,int p,int id) {
    siz[x] = 1; fa[x] = p; for(auto y : G[x]) if(y ^ p) dfs(y,x,id),siz[x] += siz[y];
    if(fib[id - 1] == siz[x] || fib[id - 2] == siz[x]) pos = x;
}

bool Div(int x,int id) {
    if(siz[x] <= 1) return true;
    pos = 0; dfs(x,0,id); if(!pos) return false;
    G[fa[pos]].erase(pos); G[pos].erase(fa[pos]);
    if(inb[siz[pos]] == id - 1) return Div(pos,id - 1) && Div(x,id - 2);
    else return Div(pos,id - 2) && Div(x,id - 1);
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("1.in","r",stdin);
#endif
    n = in; for(int i = 1,u,v;i < n;i++) u = in,v = in,G[u].insert(v),G[v].insert(u);
    fib[0] = fib[1] = 1; for(int i = 2;i <= 27;i++) fib[i] = fib[i - 1] + fib[i - 2],inb[fib[i]] = i;
    dfs(1,0,0);
    if(!Div(1,inb[n])) puts("NO");
    else puts("YES"); return 0;
} 
